home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2007 January, February, March & April
/
Chip-Cover-CD-2007-02.iso
/
Pakiet bezpieczenstwa
/
mini Pentoo LiveCD 2006.1
/
mpentoo-2006.1.iso
/
livecd.squashfs
/
usr
/
local
/
sbin
/
monitor
next >
Wrap
Text File
|
2006-05-14
|
5KB
|
219 lines
#!/bin/sh
# Original work by Thomas d'Otreppe : airmon-ng
# Modded by Grimmlin for pentoo
KISMET=/etc/kismet.conf
CH=$3; [ x$3 = "x" ] && CH=10
which iwpriv &> /dev/null ||
{ echo Wireless tools not found ; exit ; }
function startStdIface() {
iwconfig $1 mode monitor 2> /dev/null >/dev/null
iwconfig $1 channel $2 2> /dev/null >/dev/null
iwconfig $1 key off 2> /dev/null >/dev/null
ifconfig $1 up
echo -n " (monitor mode enabled)"
}
function stopStdIface() {
ifconfig $1 down
iwconfig $1 mode Managed 2> /dev/null >/dev/null
echo -n " (monitor mode disabled)"
}
cp $KISMET~ $KISMET 2>/dev/null &&
for iface in `iwconfig 2>/dev/null | egrep '(IEEE|ESSID)' | cut -b 1-8 | grep -v wifi`
do
if [ x"`iwpriv $iface 2>/dev/null | grep force_reset`" != "x" ]
then
echo -e -n "$iface\t\tHermesI\t\torinoco"
echo "source=orinoco,$iface,HermesI" >>$KISMET
iwconfig $iface mode Monitor channel $CH &>/dev/null
iwpriv $iface monitor 1 $CH &>/dev/null
ifconfig $iface up
echo -n " (monitor mode enabled)"
continue
fi
if [ `iwpriv $iface 2>/dev/null | grep -v $iface | md5sum | awk '{print $1}'` == "2310629be8b9051238cde37520d97755" ]
then
echo -e -n "$iface\t\tCentrino b\tipw2100"
echo "source=ipw2100,$iface,Centrino_b" >>$KISMET
startStdIface $iface $CH
echo
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep sw_reset`" != "x" ]
then
echo -e -n "$iface\t\tCentrino b/g\tipw2200"
echo "source=ipw2200,$iface,Centrino_g" >>$KISMET
startStdIface $iface $CH
echo
continue
fi
## Added by Grimmlin for cisco aironet card
if [ x"`iwpriv $iface 2>/dev/null | grep airo`" != "x" ]
then
echo -e -n "$iface\t\tCisco Aironet\tairo"
echo "source=cisco_wifix,$iface:wifi0,ciscosource" >>$KISMET
startStdIface $iface $CH
echo
continue
fi
## Added by Grimmlin for ralink rt2x00 card
if [ x"$iface" = "xwlan0.11" ]
then
echo -e -n "$iface\t\tRalink b/g\trt2x00"
echo "source=rt2500,$iface,Ralink_g" >>$KISMET
startStdIface $iface $CH
echo
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep inact_auth`" != "x" ]
then
if [ -e "/proc/sys/net/$iface/%parent" ]
then
echo -e "$iface\t\tAtheros\t\tmadwifi-ng VAP (parent: `cat /proc/sys/net/$iface/%parent`)"
wlanconfig $iface destroy
echo -n " (VAP destroyed)"
continue
fi
echo
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep extrates`" != "x" ]
then
echo -e -n "$iface\t\tPrismGT\t\tprism54"
echo "source=prism54g,$iface,Prism54" >>$KISMET
ifconfig $iface up
iwconfig $iface mode Monitor channel $CH
iwpriv $iface set_prismhdr 1 &>/dev/null
echo -n " (monitor mode enabled)"
echo
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep antsel_rx`" != "x" ]
then
echo -e -n "$iface\t\tPrism2\t\tHostAP"
echo "source=hostap,$iface,Prism2" >>$KISMET
iwconfig $iface mode Monitor channel $CH
iwpriv $iface monitor_type 1 &>/dev/null
ifconfig $iface up
echo -n " (monitor mode enabled)"
echo
continue
fi
if [ x"`wlancfg show $iface 2>/dev/null | grep p2CnfWEPFlags`" != "x" ]
then
echo -e -n "$iface\t\tPrism2\t\twlan-ng"
cp $KISMET~ $KISMET 2>/dev/null &&
echo "source=wlanng,$iface,Prism2" >>$KISMET
wlanctl-ng $iface lnxreq_ifstate ifstate=enable >/dev/null
wlanctl-ng $iface lnxreq_wlansniff enable=true channel=$CH \
prismheader=true wlanheader=false \
stripfcs=true keepwepflags=true >/dev/null
echo p2CnfWEPFlags=0,4,7 | wlancfg set $iface
ifconfig $iface up
echo -n " (monitor mode enabled)"
echo
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep bbp`" != "x" ]
then
echo -e -n "$iface\t\tRalink b/g\trt2500"
echo "source=rt2500,$iface,Ralink_g" >>$KISMET
startStdIface $iface $CH
echo
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep wpapsk`" != "x" ]
then
echo -e -n "$iface\t\tRalink USB\trt2570"
echo "source=rt2500,$iface,Ralink_g" >>$KISMET
startStdIface $iface $CH
echo
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep debugtx`" != "x" ]
then
echo -e -n "$iface\t\tRTL8180\t\tr8180"
echo "source=rt8180,$iface,Realtek" >>$KISMET
iwconfig $iface mode Monitor channel $CH
iwpriv $iface prismhdr 1 &>/dev/null
ifconfig $iface up
echo -n " (monitor mode enabled)"
echo
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep dbg_flag`" != "x" ]
then
echo -e -n "$iface\t\tZyDAS\t\tzd1211"
echo "source=wlanng_legacy,$iface,ZyDAS" >>$KISMET
startStdIface $iface $CH
echo
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep GetAcx1`" != "x" ]
then
echo -e -n "$iface\t\tTI\t\tacx111"
echo "source=acx100,$iface,TI" >>$KISMET
startStdIface $iface $CH
echo
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep write_sprom`" != "x" ]
then
echo -e -n "$iface\t\tBroadcom\t\tbcm43xx"
cp $KISMET~ $KISMET 2>/dev/null &&
echo "source=bcm43xx,$iface,broadcom" >>$KISMET
startStdIface $iface $CH
echo
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep ndis_reset`" != "x" ]
then
echo -e " (MONITOR MODE NOT SUPPORTED)"
echo
continue
fi
echo -e "$iface\t\tUnknown\t\tUnknown (MONITOR MODE NOT SUPPORTED)"
done
for iface in `ifconfig -a 2>/dev/null | egrep HWaddr | cut -b 1-7`
do
if [ -e "/proc/sys/dev/$iface/fftxqmin" ]
then
ifconfig $iface up
echo -e -n "$iface\t\tAtheros\t\tmadwifi-ng"
IFACE=`wlanconfig ath create wlandev $iface wlanmode monitor`
echo "source=madwifing_g,$iface,Atheros" >>$KISMET
iwconfig $IFACE channel $CH
echo -n " (monitor mode enabled)"
echo
continue
fi
done
echo